<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="../../../layui/css/layui.css">
</head>
<body>
<form class="layui-form" action="javascript:;" id="form-process">
    <input  style="display: none" type="text" id="aid" name="aid" autocomplete="off" class="layui-input">
    <div class="layui-form-item">
        <label class="layui-form-label">课程名称</label>
        <div class="layui-input-block">
            <input type="text" id="name" placeholder="" autocomplete="off" class="layui-input" style="border-style:none" readonly>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">课程审核</label>
        <div class="layui-input-block">
            <input type="radio" name="auditresults" value="审核通过" title="审核通过">
            <input type="radio" name="auditresults" value="审核不通过" title="审核不通过" checked>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">反馈详情</label>
        <div class="layui-input-block">
            <textarea name="feedbackdetails" required lay-verify="required" placeholder="请输入反馈内容" class="layui-textarea" style="width: 400px;height: 300px"></textarea>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="formDemo">提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">取消</button>
        </div>
    </div>
</form>
<script src="../../../js/jquery-3.6.0.js"></script>
<script src="../../../layui/layui.js"></script>
<script>
    layui.use('form', function () {
        var form = layui.form;
        form.on('submit(formDemo)', function(data){
            $.ajax({
                url: "/primary/addcourseprocess",
                type: "POST",
                data: $("#form-process").serialize(),
                dataType: "json",
                success: function(res) {
                    console.log(res)
                    if (res.state == 200) {
                        alert("审核成功！");
                        parent.refresh1();
                        if(top.window['upload']){
                            top.window['upload'].frames.location.reload();
                        }
                        var index = parent.layer.getFrameIndex(window.name);
                        parent.layer.close(index);
                    } else {
                        alert("审核失败！请重新审核");
                    }
                }
            });
            return false;
        });
    });
</script>
</body>
</html>
